package com.example.javalib.for_test;

public class ForTest {
    public static void main(String[] args) {
//ninePlusNine();
        printStar();
    }

    private static void printStar() {
        for (int i = 3; i >0; i--) {

            for ( int j=5; j >0; j--) {

                if (i<=j && j*i<10){
                    System.out.print("*");
                }else {
                    System.out.print(" ");
                }

//                if (i*j<10){
//                    System.out.print("*");
//
//                }else {
//                    System.out.print("0");
//                }

            }
            System.out.println();
        }
    }

    static void ninePlusNine(){
        for (int i = 1; i <=9; i++) {
            //i 控制列
            System.out.print("i="+i+":");
            //j 控制行

            for (int j = 1; j <=9; j++) {
//                从上到下，从左到右
                if (j<=i) {
                    System.out.print(j+"*"+i+"="+(i*j)+"  ");
                }

            }
            System.out.println();
        }
    }
}
